package com.yuexunit.operationman.nbsy.module.Catheter.model.impl;

import com.yuexunit.operationman.nbsy.Api.Api;
import com.yuexunit.operationman.nbsy.base.SubmitBean;
import com.yuexunit.operationman.nbsy.module.Catheter.model.ICatheterModel;
import com.yuexunit.operationman.nbsy.util.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by work-jx on 2017/7/25.
 */
public class CatheterModel implements ICatheterModel {
    Api api;

    public  Api getApiInstance() {
        if(api!=null) {
            return api;
        }else{
            api= ApiUtil.getInstance().createRetrofitApi(Api.class);
            return api;
        }
    }


    @Override
    public Observable<SubmitBean> insertCatheterDate(Map<String, String> praise) {
        api=getApiInstance();
        return api.insertCatheterInfo(praise);
    }

    @Override
    public Observable<SubmitBean> updateCatheterDate(Map<String, String> praise) {
        api=getApiInstance();
        return api.updateCatheterInfo(praise);
    }
}
